<!DOCTYPE html>
<html lang='en'>

<head>
    <meta charset='UTF-8'>
    <meta http-equiv='X-UA-Compatible' content='IE=edge'>
    <meta name='viewport' content='width=device-width, initial-scale=1.0'>
    <title>Document</title>
    <script src='../vue.global.js'></script>
</head>

<body>
    <div id='app'>
        <!-- 完整语法 -->
        <a v-bind:href="url"> ... </a>
        <br>

        <!-- 缩写 -->
        <a :href="url"> ... </a>
        <br>

        <!-- 动态参数的缩写 -->
        <!-- <a :[key]="url"> ... </a> -->

        <!-- 完整语法 -->
        <a v-on:click="doSomething"> ... </a>

        <!-- 缩写 -->
        <a @click="doSomething"> ... </a>

        <!-- 动态参数的缩写 -->
        <a @[event]="doSomething"> ... </a>
    </div>
    <script>
        const app = Vue.createApp({
            data() {
                return {
                    url: "http://www.baidu.com",
                    event:"click"
                }
            },
            methods: {
                doSomething() {
                    console.log("doSomething");
                }
            }
        })
        const vm = app.mount('#app')
    </script>
</body>

</html>